import 'package:get_it/get_it.dart';
import 'package:mobile_app.home.collections/lexical_item_addition_page/domain/use_cases/get_initial_data/use_case.dart';
import 'package:mobile_app.home.collections/lexical_item_addition_page/domain/use_cases/handle_learning_content_outer_update/use_case.dart';
import 'package:mobile_app.home.collections/lexical_item_addition_page/domain/use_cases/suggest_lexical_items/use_case.dart';
import 'package:mobile_app.home.collections.core/injection_container.dart' as collection_core_di;
import 'package:mobile_app.home.core/injection_container.dart' as home_core_di;

final sl = GetIt.asNewInstance();

Future<void> init() async {
  // use cases

  sl.registerLazySingleton<SuggestLexicalItems>(() {
    return SuggestLexicalItemsImpl(
      sortLexicalItems: home_core_di.sl(),
      filterLexicalItemsByPrefix: collection_core_di.sl(),
      isLexicalItemTitlePrefix: collection_core_di.sl(),
    );
  });

  sl.registerLazySingleton<GetInitialData>(() {
    return GetInitialDataImpl(
      sortLexicalItems: home_core_di.sl(),
      isLexicalItemTitlePrefix: collection_core_di.sl(),
      getLexicalItemProgressPercentMap: home_core_di.sl(),
    );
  });

  sl.registerLazySingleton<HandleLearningContentOuterUpdate>(() {
    return HandleLearningContentOuterUpdateImpl(
      sortLexicalItems: home_core_di.sl(),
      findCollection: home_core_di.sl(),
      filterLexicalItemsByPrefix: collection_core_di.sl(),
      isLexicalItemTitlePrefix: collection_core_di.sl(),
      getLexicalItemProgressPercentMap: home_core_di.sl(),
    );
  });
}
